package org.example.jdk21demo.model;

/**
 * 计算器类，用于Javassist方法注入测试
 */
public class Calculator {
    
    public int add(int a, int b) {
        return a + b;
    }
    
    public int subtract(int a, int b) {
        return a - b;
    }
    
    public int multiply(int a, int b) {
        return a * b;
    }
    
    public double divide(double a, double b) {
        if (b == 0) {
            throw new IllegalArgumentException("Division by zero is not allowed");
        }
        return a / b;
    }
    
    public void printResult(String operation, double result) {
        System.out.println("Operation: " + operation + ", Result: " + result);
    }
}